using System;
using System.Linq;
using Bootstrap.Models;
using Bootstrap.Services;

namespace Bootstrap.Features {
	public class Variables : IBootstrapFeature, IBootstrapDefaults {
		public void Describe(FeatureDescriptionContext context) {
			context
				.Describe(
					"Variables",
					feature =>
					feature
						.IsType("Insert")
												.WithDisplayName("Variables")
						.WithCategory(FeatureCategories.CoreVariablesAndMixins, 1000)
						.WithAction(
							cntxt => 
																								cntxt
									.AvailableVariables()
									.Select(
										variable => 
											String.Format("@{0}:{1};\n", variable.Key, variable.Value)
									).ToArray()
															)
				);
		}

		public int Priority {
	        get { return 0; }
	    }

		public void Define(BootstrapDefaultSettingsContext context) {
			context.Feature("Variables", feature => feature.Enabled().Position(2));
		}
	}
}